<template>
  <view>
    <view>
      <page-head title="rich-text,富文本"></page-head>
      <view class="smart-padding-wrap">
        <view><rich-text :nodes="nodes"></rich-text></view>
        <view><rich-text :nodes="strings"></rich-text></view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      nodes: [
        {
          name: 'div',
          attrs: {
            class: 'div-class',
            style: 'line-height: 60px; color: red; text-align: center; background-color: #09BB07; padding: 10px 0;'
          },
          children: [
            {
              type: 'text',
              text: 'Hello uni-app!'
            }
          ]
        }
      ],
      strings: '<div style="text-align:center;margin-top:50px;">< img src="/static/logo.png"></div>'
    };
  },
  methods: {
    // 方法定义
  }
}
</script>

<style scoped>
.div-class {
  font-size: 24px;
}
.smart-padding-wrap {
  padding: 20px;
}
</style>